package edu.spec.lyq.week05.class1;

public class Main {

        public static void main(String[] args)
        {
            Animal a = new Animal("猩猩","man",6,"香蕉");
            a.born();
            a.eat();
            a.breed();
            Dog d = new Dog("旺财","women",4,"狗粮","哈士奇","嗷嗷嗷嗷嗷嗷~~");
            d.born();
            d.eat();
            d.breed();
            d.find();


        }
    }
    class Animal {
        private String name;
        private String gender;
        private int age;
        private String food;
        public Animal(){

        }
        public Animal(String name,String gender,int age,String food){
            this.name = name;
            this.gender = gender;
            this.age = age;
            this.food = food;
        }
        public void born(){
            System.out.println("I was born with "+this.name);
        }
        public void eat(){
            System.out.println("I am "+this.name+",i eat "+this.food);
        }
        public void breed(){
            System.out.println("i breed fast");
        }

    }
    class Mammal extends Animal{

        private String name;
        private String gender;
        private int age;
        private String food;
        public Mammal(){

        }
        public Mammal(String name,String gender,int age,String food){
            this.name = name;
            this.gender = gender;
            this.age = age;
            this.food = food;
        }
        public void born(){
            System.out.println("I was born with "+this.name);
        }
        public void eat(){
            System.out.println("I am "+this.name+",i eat "+this.food);
        }
        public void breed(){
            System.out.println("i breed fast");
        }


    }
    class Dog extends Animal {
        private String name;
        private String gender;
        private int age;
        private String food;
        private String kind;
        private String barkSound;
        public Dog(){

        }
        public Dog(String name,String gender,int age,String food,String kind,String barkSound){
            this.name = name;
            this.gender = gender;
            this.age = age;
            this.food = food;
            this.kind = kind;
            this.barkSound = barkSound;
        }
        public void find(){
            System.out.println("I can help the owner get the ball back");
        }
        public void born(){
            System.out.println("I was born with "+this.name);
        }
        public void eat(){
            System.out.println("I am "+this.name+",i eat "+this.food);
        }
        public void breed(){
            System.out.println("i breed fast");
        }
        public void bark(){
            System.out.println("I kind is "+this.kind+",i barkSound is "+this.barkSound);
        }

}
